package cn.lovecyy.mockjson.core.context;

import java.util.HashMap;
import java.util.Map;

/**
 * ContextGeneratorRegistry
 *
 * @author Yakir
 */
public class ContextGeneratorRegistry {

	private static final Map<String, ContextGenerator> registry = new HashMap<>();
	static {
		// 内置
		registry.put("person", new PersonContextGenerator());
		registry.put("bank", new BankContextGenerator());
		registry.put("company", new CompanyContextGenerator());

	}

	public static void register(String key, ContextGenerator generator) {
		registry.put(key, generator);
	}

	public static ContextGenerator get(String key) {
		return registry.get(key);
	}

}
